package com.wd.dao.impl;

import com.wd.dao.CollectionDao;
import com.wd.util.DBUtil;

public class CollectionDaoImpl implements CollectionDao {

    @Override
    public void like(String username, int blogid) throws Exception {
        String sql="insert into collection values(default,?,?);";
        Object[] object=new Object[]{username,blogid};
        DBUtil.executeUpdate(sql,object);
        DBUtil.closeAll();
    }

    @Override
    public void delCollectionByBlogId(int blogid) throws Exception {
        String sql="delete from blog where blogid=?";
        Object[] object=new Object[]{blogid};
        int i = DBUtil.executeUpdate(sql, object);
        DBUtil.closeAll();
    }
}
